package dao

//Mysql
var DbCfg = struct {
	DbUser string
	DbPass string
	DbHost string
	DbPort string
	DbName string
}{
	DbUser: "root",
	DbPass: "123456",
	DbHost: "127.0.0.1",
	DbPort: "3306",
	DbName: "blog",
}

//Http
var HttpCfg = struct {
	Listen string
	Port   string
}{
	Listen: "0.0.0.0",
	Port:   "8080",
}

//Redis
var RedisConf = struct {
	Network string
	Address string
}{
	Network: "tcp",
	Address: "127.0.0.1:6379",
}

//运行配置
var RunCFG = struct {
	UserPassExt         string //用户密码扩展加密串
	RequestLogFile      string //请求日志文件
	ErrorLogFile        string //错误日志文件
	ServiceStartLogFile string //服务启动日志
	SessionTime         int    //Session缓存时长
}{
	UserPassExt:         "www+lixiaocheng+com+UserPassExtension",
	RequestLogFile:      "log/request.log",
	ErrorLogFile:        "log/error.log",
	ServiceStartLogFile: "log/serviceStart.log",
	SessionTime:         6 * 3600, //6小时
}

var EsConf = map[string]string{
	"URL":             "http://localhost:9200",
	"INDEX_NAME_POST": "posts", //索引名不能包含大些字母
	"INDEX_POST_MAPPING": `{
		"posts": {
			"properties": {
				"id": {"type": "integer"},
				"type":{"type": "integer"},
				"title": {"type": "text","analyzer": "ik_max_word","search_analyzer": "ik_max_word"},
				"content": {"type": "text","analyzer": "ik_max_word","search_analyzer": "ik_max_word"},
				"create_time":{"type":"date"}
			}
		}
	}`,
	"INDEX_NAME_ACCESS": "access", //索引名不能包含大些字母

}
